home *** CD-ROM | disk | FTP | other *** search
/ InterCD 2000 September / september_2000.iso / intercd / root / ^Linux / cdrtools-1.10 / PORTING < prev    next >
Encoding:
Text File  |  1999-11-14  |  4.6 KB  |  151 lines

  1. Porting FAQ for SING (Schily Is Not Gnu) utilities.
  2.  
  3. -    The base for porting is the makefile system.
  4.     Always look into:
  5.         ftp://ftp.fokus.gmd.de/pub/unix/makefiles
  6.     for a version that might be newer than the one used
  7.     inside the program that should be ported.
  8.  
  9.     If you want to know more about the makefile system,
  10.     read the man pages makefiles4 and makerules.4,
  11.     they are located in man/man4/*
  12.  
  13.         to convert a manpage troff->postscript use:
  14.             gtroff -man file.tr | grops > file.ps
  15.  
  16.         to convert a manpage troff->Terminal use:
  17.             nroff -man file.tr | more -s
  18.  
  19.  
  20. -    To be able to use the makefile system, you need a
  21.     make program that meets the minimum requirements 
  22.     for a make program (see makerules(4) man page)
  23.     Currently, the following make programs meet this
  24.     minimum requirements: Smake (my program), SunPro Make and Gmake
  25.  
  26.     A good idea is to first compile 'smake' if you don't
  27.     have it already.
  28.  
  29.     The smake source can be found on:
  30.  
  31.         ftp://fokus.gmd.de/pub/unix/smake/
  32.     or
  33.         ftp://fokus.gmd.de/pub/unix/smake/alpha
  34.  
  35.     for the most recent version.
  36.  
  37.     The most recent 'smake' binaries that I have created so far
  38.     can be found in:
  39.  
  40.         ftp://fokus.gmd.de/pub/unix/makefiles/bin
  41.  
  42.     Note that these binaries must not necessarily be up to
  43.     date compared to the latest source distribution.
  44.  
  45. -    To be able to use the makefile system with gmake,
  46.     the operating system must have a command named 'uname'.
  47.     If not, you have to provide it as a shell script.
  48.  
  49.  
  50. 1)    If you are using smake release 1.1 or newer and 
  51.     a recent makefile system, the next step should be done
  52.     automagically (smake-1.1 or newer implement a -version
  53.     option to retrieve the vesion number).
  54.  
  55.     If you are using gmake, you need to do this by hand.
  56.  
  57.     First step for adding a new architecture is creating
  58.     the appropriate rule files in the RULES directory:
  59.  
  60.         RULES/os-{newos}.id    For OS identification
  61.         RULES/os-{newos}.def    For OS definition (man style)
  62.         RULES/{newarch}-{newos}-cc.rul
  63.         RULES/{newarch}-{newos}-gcc.rul
  64.  
  65.     And create a file:
  66.  
  67.         DEFAULTS/Defaults.{newos}
  68.  
  69.     Have a look in similar files for a template.
  70.  
  71.     If the files hae been generated automagically by smake,
  72.     please check the content and mail me a working set for your OS.
  73.  
  74. 2)    All C-porting control is located in include/mconfig.h
  75.     and in the file incs/{newarch}-{newos}-{cc!gcc}/xconfig.h
  76.     The later file is created automatically using GNU 
  77.     configure. The File conf/xconfig.h.in contains all
  78.     templates and comments for the various things that are tested.
  79.  
  80.     In any case, it is recommended to carefully watch the
  81.     outout from the 'configure' run (which is automatically
  82.     started from within 'make'). You may also wish to check all
  83.     files that are created in the directory 
  84.     incs/{newarch}-{newos}-{cc!gcc}/
  85.  
  86. 3)    Everything should compile now.
  87.     If not, try to hack the files and mail me your problems.
  88.  
  89.     You should have a closer look at the sources as it may be that
  90.     the first attempt to port a utility will not support
  91.     all possible features of the new OS.
  92.     If your OS supportes these features in a non standard way,
  93.     you need to hack conf/configure.in and the source and add 
  94.     support for the non standard behaviour of your OS.
  95.  
  96.     This is definitely recommended if you want to port programs 
  97.     like 'cdrecord' 'star' and similar which need fork(2) and
  98.     mmap(2) or setprioriry(2) or if you check programs on
  99.     non POSIX operating systems like W95/W98/WNT OS/2 and
  100.     similar.
  101.  
  102.  
  103. Notice for porting tools, that use the SCSI library libscg:
  104.  
  105. I)    Cdrecord should compile at this moment if you are using
  106.     a new architecture. The SCSI transport however will not work.
  107.     Check this!
  108.  
  109.     All files that contain low level code for SCSI transport are 
  110.     located in the directory libscg/
  111.  
  112. II)    Implementing a SCSI Transport Layer for your architecture:
  113.  
  114.     You need to add a new block into scsihack.c that will add
  115.     support for your OS. Copy the block:
  116.  
  117.     #ifdef  __NEW_ARCHITECTURE
  118.     #define SCSI_IMPL               /* We have a SCSI implementation for XXX */
  119.     /*
  120.      * Add new hacks here
  121.      */
  122.     #include "scsi-new-arch.c"
  123.     #endif
  124.  
  125.     and rename __NEW_ARCHITECTURE to reflect your new architecture.
  126.  
  127.     Add a new file that will be called scsi-{newarch}.c
  128.     Have a look into scsi-linux-sg.c for a template how to do this.
  129.  
  130.     More hints for writing the needed SCSI low level transport functions
  131.     is in:
  132.  
  133.         ftp://fokus.gmd.de/pub/unix/cdrecord/README.scsi-IF
  134.  
  135. 4)    Test your ported program.
  136.  
  137. 5)    You may check other programs from me to see if everything compiles
  138.     and works.
  139.  
  140. 6)    Send me your changes
  141.  
  142. Joerg Schilling
  143.  
  144. schilling@fokus.gmd.de
  145. joerg@schily.isdn.cs.tu-berlin.de
  146. js@cs.tu-berlin.de
  147.  
  148.  
  149.  
  150.  
  151.